package day03;
//if.....else  结构演示
public class IfElseDemo {
    public static void main(String[] args) {
        //1. 满500打八折,不满打9折
        double money = 300;
        if (money>=500){
            money*=0.8;
        }else {
            money*=0.9;
        }
        System.out.println("打折后的金额:"+money);
        //2. 判断成绩是否合法
        double score=-99;
        if (score>=0&&score<=100){
            System.out.println("成绩合法"+score);
        }else {
            System.out.println("成绩不合法"+score);
        }
        //3. 是否开门
        boolean isOpen=true;
        if (isOpen){
            System.out.println("开门");
        }else {
            System.out.println("不开门");
        }
        //4. 得到一个年龄到20~30岁的女孩子
        int age=25;
        char sex='女';
        if (age>=20&&age<=30&&sex=='女'){
            System.out.println("年龄合法:"+age+"性别合法:"+sex);
        }else {
            System.out.println("年龄不合法:"+age+"性别不合法:"+sex);
        }
    }
}
